<template>
  <div class="right-board">
    <el-tabs v-model="currentTab" class="center-tabs">
      <el-tab-pane label="组件属性" name="field" />
      <el-tab-pane label="表单属性" name="form" />
    </el-tabs>
    <div class="field-box">
      <a class="document-link" target="_blank" :href="documentLink" title="查看组件文档">
        <i class="el-icon-link" />
      </a>
      <el-scrollbar class="right-scrollbar">
        <!-- 组件属性 -->
        <el-form v-show="currentTab==='field' && showField" size="small" label-width="90px">
          <el-form-item v-if="activeData.__config__.changeTag" label="组件类型">
            <el-select
              v-model="activeData.__config__.tagIcon"
              placeholder="请选择组件类型"
              :style="{width: '100%'}"
              @change="tagChange"
            >
              <el-option-group v-for="group in tagList" :key="group.label" :label="group.label">
                <el-option
                  v-for="item in group.options"
                  :key="item.__config__.label"
                  :label="item.__config__.label"
                  :value="item.__config__.tagIcon"
                >
                  <svg-icon class="node-icon" :icon-class="item.__config__.tagIcon" />
                  <span> {{ item.__config__.label }}</span>
                </el-option>
              </el-option-group>
            </el-select>
          </el-form-item>
          <template v-if="activeData.__config__.tag==='LenovoPopup' && activeData.dataType">
           <el-form-item label="数据类型">
               <el-radio-group v-model="activeData.dataType" size="small" @change="changeDataType">
                 <el-radio-button label="datasource">
                   数据源
                 </el-radio-button>
                 <el-radio-button label="dictionary">
                   数据字典
                 </el-radio-button>
               </el-radio-group>
             </el-form-item>
              <template v-if="activeData.dataType === 'datasource'">
               <el-form-item label="数据来源">
                 <el-select v-model="activeData.dataSource" @change="changeTableName">
                  <el-option v-for="item in allTables" :key="item.value" :label="item.label" :value="item.value"  style="width:227px;">
                  </el-option>
                 </el-select>
               </el-form-item>
               <el-form-item label="显示字段">
                 <el-select v-model="activeData.fieldName">
                   <el-option v-for="item in tableColumns" :key="item.value" :label="item.label" :value="item.value" style="width:227px;">
                   </el-option>
                 </el-select>
               </el-form-item>
             </template>
             <template v-else>
               <el-form-item label="数据字典">
                  <el-select v-model="activeData.dictName">
                    <el-option v-for="item in dictOptions" :key="item.value" :label="item.label" :value="item.value"  style="width:227px;">
                    </el-option>
                  </el-select>
               </el-form-item>
             </template>
          </template>
          <el-form-item v-if="activeData.__vModel__!==undefined" label="字段名">
            <el-input v-model="activeData.__vModel__" placeholder="请输入字段名（v-model）" />
          </el-form-item>
          <el-form-item v-if="activeData.__config__.componentName!==undefined && activeData.__config__.tag!=='Subform'" label="组件名">
            {{ activeData.__config__.componentName }}
          </el-form-item>
           <el-form-item v-if="activeData.__config__.label!==undefined" label="标题">
            <el-input v-if="activeData.__config__.tag!=='TitleLine'" v-model="activeData.__config__.label" placeholder="请输入标题" @input="(val)=>{changeRenderKey();changePlaceholder(val)}"/>
             <el-input v-else v-model="activeData.content" placeholder="请输入标题" @input="changeRenderKey" />
          </el-form-item>
          <el-form-item v-if="activeData.placeholder!==undefined && activeData.__config__.tag!=='Subform'" label="占位提示">
            <el-input v-model="activeData.placeholder" placeholder="请输入占位提示" @input="changeRenderKey" />
          </el-form-item>
          <el-form-item v-if="activeData.__config__.codingRules" label="编码规则">
            <el-select  placeholder="请选择规则" @change="changeRulesValue" v-model="activeData.rulesSelectValue">
              <el-option :label='v.encodeName' :value='v.id' v-for='v in rulesArray' :key='v.id'>{{v.encodeName}}</el-option>
            </el-select>
          </el-form-item>
          <el-form-item v-if="activeData['start-placeholder']!==undefined" label="开始占位">
            <el-input v-model="activeData['start-placeholder']" placeholder="请输入占位提示" />
          </el-form-item>
          <el-form-item v-if="activeData['end-placeholder']!==undefined" label="结束占位">
            <el-input v-model="activeData['end-placeholder']" placeholder="请输入占位提示" />
          </el-form-item>
          <el-form-item label="描述信息" v-if="activeData.__config__.tag!=='Subform' && activeData.__config__.tag!=='TitleLine' && activeData.__config__.tag!=='el-tabs' && activeData.__config__.tag!=='Steps' && activeData.__config__.tag!=='el-collapse'">
            <el-input type="textarea" :rows="2" v-model="activeData.__config__.descriptionMessage" placeholder="请输入描述信息" @input="changeRenderKey"/>
          </el-form-item>
          <el-form-item v-if="activeData.__config__.span!==undefined" label="表单栅格">
            <el-slider v-model="activeData.__config__.span" :max="24" :min="1" :marks="{12:''}" @change="spanChange" />
          </el-form-item>
          <el-form-item v-if="activeData.__config__.layout==='rowFormItem'&&activeData.gutter!==undefined" label="栅格间隔">
            <el-input-number v-model="activeData.gutter" :min="0" placeholder="栅格间隔" />
          </el-form-item>
          <el-form-item v-if="activeData.__config__.layout==='rowFormItem' && activeData.type!==undefined && activeData.__config__.tag !== 'el-tabs'&& activeData.__config__.tag !== 'el-collapse'" label="布局模式">
            <el-radio-group v-model="activeData.type">
              <el-radio-button label="default" />
              <el-radio-button label="flex" />
            </el-radio-group>
          </el-form-item>
          <el-form-item v-if="activeData.justify!==undefined&&activeData.type==='flex'" label="水平排列">
            <el-select v-model="activeData.justify" placeholder="请选择水平排列" :style="{width: '100%'}">
              <el-option
                v-for="(item, index) in justifyOptions"
                :key="index"
                :label="item.label"
                :value="item.value"
              />
            </el-select>
          </el-form-item>
          <el-form-item v-if="activeData.align!==undefined&&activeData.type==='flex'" label="垂直排列">
            <el-radio-group v-model="activeData.align">
              <el-radio-button label="top" />
              <el-radio-button label="middle" />
              <el-radio-button label="bottom" />
            </el-radio-group>
          </el-form-item>
          <el-form-item v-if="activeData.__config__.labelWidth!==undefined" label="标签宽度">
            <el-input v-model.number="activeData.__config__.labelWidth" type="number" placeholder="请输入标签宽度" />
          </el-form-item>
           <!-- 操作按钮 -->
           <template v-if="activeData.__config__.tag==='Subform'">
            <div style='display:flex;justify-content: space-between;align-items: center;padding:0 10px;margin:0 0 8px 0'>
              <div style='fontSize:14px'>操作按钮</div>
              <el-dropdown trigger="click" style='cursor: pointer;color: #409EFF;' @command='addOptionBtn'>
                <span class="el-dropdown-link">
                  添加按钮 :
                </span>
                <el-dropdown-menu slot="dropdown" >
                  <el-dropdown-item v-for="v in btnConfig" :key='v.command' :command='v.command' :disabled='hideBtn(v)'>{{v.label}}</el-dropdown-item>
                </el-dropdown-menu>
              </el-dropdown>
            </div>
            <draggable :list="activeData['options']" :animation="340" group="selectItem" handle=".option-drag">
              <div v-for="(item, index) in activeData['options']" :key="index" class="select-item">
                <div style='display:flex;justify-content: space-between;background:#ededed;width:100%;align-items: center;padding:0 10px'>
                  <div style='fontSize:14px'>{{item.label}}</div>
                  <div style='display:flex;justify-content: space-between;align-items: center'>
                      <i class="el-icon-s-tools" style='fontSize:16px;marginRight:5px' @click="setBtn(item)"/>
                      <i class="el-icon-delete" style='fontSize:16px;margin:0 4px' @click="removeBtnOption(index)"></i>
                      <i class="el-icon-rank select-line-icon option-drag" style='fontSize:18px' />
                  </div>
                </div>
              </div>
            </draggable>
          </template>
          <el-form-item v-if="activeData.style&&activeData.style.width!==undefined" label="组件宽度">
            <el-input v-model="activeData.style.width" placeholder="请输入组件宽度" clearable  @input="changeRenderKey"/>
          </el-form-item>
          <el-form-item v-if="activeData.__vModel__!==undefined && !activeData.defaultValueCheck && activeData.__config__.tag!=='Steps' && activeData.__config__.tag!=='TitleLine'" label="默认值">
            <el-input
              :value="setDefaultValue(activeData.__config__.defaultValue)"
              placeholder="请选择"
              @input="onDefaultValueInput"
            />
          </el-form-item>
          <el-form-item v-if="['UsersSelector','PostSelection','DepartmentSelection'].indexOf(activeData.__config__.tag) > -1" label="默认值" >
           <el-select v-model="activeData.defaultValueKey" placeholder="请选择" :style="{width: '100%'}" @change='defaultValueChange'>
              <el-option
                v-for="(item, index) in defaultSelectOptions"
                :key="index"
                :label="item.label"
                :value="item.value"
                style="width:227px;"
              />
            </el-select>
          </el-form-item>
          <el-form-item v-if="activeData.defaultValueKey==='stickValue'" label="" >
             <el-input :style="{width: '100%'}" @focus='defaultBtn' prefix-icon='el-icon-plus'   placeholder="请选择" ref="selectBox"></el-input>
          </el-form-item>
          <el-form-item v-if="activeData.defaultValueKey==='presetValue'" label="" >
            <el-input :style="{width: '100%'}" disabled :value="'当前' + activeData.__config__.label"></el-input>
          </el-form-item>
          <el-form-item v-if="activeData.__config__.tag==='el-checkbox-group'" label="至少应选">
            <el-input-number
              :value="activeData.min"
              :min="0"
              placeholder="至少应选"
              @input="$set(activeData, 'min', $event?$event:undefined)"
            />
          </el-form-item>
           <el-form-item v-if="activeData.__config__.tag==='TitleLine'" label="颜色">
            <el-color-picker v-model="activeData.styleConfig.color"></el-color-picker>
          </el-form-item>
           <el-form-item v-if="activeData.type==='title'" label="字体大小">
             <el-input-number v-model="activeData.styleConfig.fontSize" :min="1" placeholder="字体大小" />
             <span> px</span>
           </el-form-item>
          <el-form-item v-if="activeData.type==='divider'" label="上间距">
            <el-input-number v-model="activeData.styleConfig.marginTop" :min="1" placeholder="上间距" />
            <span> px</span>
          </el-form-item>
          <el-form-item v-if="activeData.type==='divider'" label="下间距">
            <el-input-number v-model="activeData.styleConfig.marginBottom" :min="1" placeholder="下间距" />
            <span> px</span>
          </el-form-item>
          <el-form-item v-if="activeData.__config__.tag==='TitleLine'" label="对齐方式">
            <el-radio-group v-model="activeData['content-position']">
              <el-radio-button label="left">
                左对齐
              </el-radio-button>
              <el-radio-button label="center">
                居中
              </el-radio-button>
              <el-radio-button label="right">
                右对齐
              </el-radio-button>
            </el-radio-group>
          </el-form-item>
          <el-form-item v-if="activeData.__config__.tag==='el-checkbox-group'" label="最多可选">
            <el-input-number
              :value="activeData.max"
              :min="0"
              placeholder="最多可选"
              @input="$set(activeData, 'max', $event?$event:undefined)"
            />
          </el-form-item>
          <template v-if="activeData.__config__.tag==='LenovoPopup'">
            <el-form-item label="前缀">
              <el-input v-model="activeData.prepend" placeholder="请输入前缀" />
            </el-form-item>
            <el-form-item  label="后缀">
              <el-input v-model="activeData.append" placeholder="请输入后缀" />
            </el-form-item>
          </template>
          <el-form-item v-if="activeData.__slot__&&activeData.__slot__.prepend!==undefined" label="前缀">
            <el-input v-model="activeData.__slot__.prepend" placeholder="请输入前缀" />
          </el-form-item>
          <el-form-item v-if="activeData.__slot__&&activeData.__slot__.append!==undefined" label="后缀">
            <el-input v-model="activeData.__slot__.append" placeholder="请输入后缀" />
          </el-form-item>
          <el-form-item v-if="activeData['prefix-icon']!==undefined" label="前图标">
            <el-input v-model="activeData['prefix-icon']" placeholder="请输入前图标名称">
              <el-button slot="append" icon="el-icon-thumb" @click="openIconsDialog('prefix-icon')">
                选择
              </el-button>
            </el-input>
          </el-form-item>
          <el-form-item v-if="activeData['suffix-icon'] !== undefined" label="后图标">
            <el-input v-model="activeData['suffix-icon']" placeholder="请输入后图标名称">
              <el-button slot="append" icon="el-icon-thumb" @click="openIconsDialog('suffix-icon')">
                选择
              </el-button>
            </el-input>
          </el-form-item>
          <el-form-item
            v-if="activeData['icon']!==undefined && activeData.__config__.tag === 'el-button'"
            label="按钮图标"
          >
            <el-input v-model="activeData['icon']" placeholder="请输入按钮图标名称">
              <el-button slot="append" icon="el-icon-thumb" @click="openIconsDialog('icon')">
                选择
              </el-button>
            </el-input>
          </el-form-item>
          <el-form-item v-if="activeData.__config__.tag === 'el-cascader'" label="选项分隔符">
            <el-input v-model="activeData.separator" placeholder="请输入选项分隔符" />
          </el-form-item>
          <el-form-item v-if="activeData.autosize !== undefined" label="最小行数">
            <el-input-number v-model="activeData.autosize.minRows" :min="1" placeholder="最小行数" />
          </el-form-item>
          <el-form-item v-if="activeData.autosize !== undefined" label="最大行数">
            <el-input-number v-model="activeData.autosize.maxRows" :min="1" placeholder="最大行数" />
          </el-form-item>
          <el-form-item v-if="isShowMin" label="最小值">
            <el-input-number v-model="activeData.min" placeholder="最小值" />
          </el-form-item>
          <el-form-item v-if="isShowMax" label="最大值">
            <el-input-number v-model="activeData.max" placeholder="最大值" />
          </el-form-item>
          <el-form-item v-if="activeData.height!==undefined" label="组件高度">
            <el-input-number v-model="activeData.height" placeholder="高度" @input="changeRenderKey" />
          </el-form-item>
          <el-form-item v-if="isShowStep" label="步长">
            <el-input-number v-model="activeData.step" placeholder="步数" />
          </el-form-item>
          <el-form-item v-if="activeData.__config__.tag === 'el-input-number'" label="精度">
            <el-input-number v-model="activeData.precision" :min="0" placeholder="精度" />
          </el-form-item>
          <el-form-item v-if="activeData.__config__.tag === 'el-input-number'" label="按钮位置">
            <el-radio-group v-model="activeData['controls-position']">
              <el-radio-button label="">
                默认
              </el-radio-button>
              <el-radio-button label="right">
                右侧
              </el-radio-button>
            </el-radio-group>
          </el-form-item>
          <el-form-item v-if="activeData.maxlength !== undefined" label="最多输入">
            <el-input v-model="activeData.maxlength" placeholder="请输入字符长度">
              <template slot="append">
                个字符
              </template>
            </el-input>
          </el-form-item>
          <el-form-item v-if="activeData['active-text'] !== undefined" label="开启提示">
            <el-input v-model="activeData['active-text']" placeholder="请输入开启提示" />
          </el-form-item>
          <el-form-item v-if="activeData['inactive-text'] !== undefined" label="关闭提示">
            <el-input v-model="activeData['inactive-text']" placeholder="请输入关闭提示" />
          </el-form-item>
          <el-form-item v-if="activeData['active-value'] !== undefined" label="开启值">
            <el-input
              :value="setDefaultValue(activeData['active-value'])"
              placeholder="请输入开启值"
              @input="onSwitchValueInput($event, 'active-value')"
            />
          </el-form-item>
          <el-form-item v-if="activeData['inactive-value'] !== undefined" label="关闭值">
            <el-input
              :value="setDefaultValue(activeData['inactive-value'])"
              placeholder="请输入关闭值"
              @input="onSwitchValueInput($event, 'inactive-value')"
            />
          </el-form-item>
          <el-form-item
            v-if="activeData.type !== undefined && 'el-date-picker' === activeData.__config__.tag"
            label="时间类型"
          >
            <el-select
              v-model="activeData.type"
              placeholder="请选择时间类型"
              :style="{ width: '100%' }"
              @change="dateTypeChange"
            >
              <el-option
                v-for="(item, index) in dateOptions"
                :key="index"
                :label="item.label"
                :value="item.value"
              />
            </el-select>
          </el-form-item>
          <el-form-item v-if="activeData.name !== undefined" label="文件字段名">
            <el-input v-model="activeData.name" placeholder="请输入上传文件字段名" />
          </el-form-item>
          <el-form-item v-if="activeData.accept !== undefined" label="文件类型">
            <el-select
              v-model="activeData.accept"
              placeholder="请选择文件类型"
              :style="{ width: '100%' }"
              clearable
            >
              <el-option label="图片" value="image/*" />
              <el-option label="视频" value="video/*" />
              <el-option label="音频" value="audio/*" />
              <el-option label="excel" value=".xls,.xlsx" />
              <el-option label="word" value=".doc,.docx" />
              <el-option label="pdf" value=".pdf" />
              <el-option label="txt" value=".txt" />
            </el-select>
          </el-form-item>
          <el-form-item v-if="activeData.__config__.fileSize !== undefined" label="文件大小">
            <el-input v-model.number="activeData.__config__.fileSize" placeholder="请输入文件大小">
              <el-select slot="append" v-model="activeData.__config__.sizeUnit" :style="{ width: '66px' }">
                <el-option label="KB" value="KB" />
                <el-option label="MB" value="MB" />
                <el-option label="GB" value="GB" />
              </el-select>
            </el-input>
          </el-form-item>
          <el-form-item v-if="activeData.action !== undefined" label="上传地址">
            <el-input v-model="activeData.action" placeholder="请输入上传地址" clearable disabled/>
          </el-form-item>
          <el-form-item v-if="activeData['list-type'] !== undefined" label="列表类型">
            <el-radio-group v-model="activeData['list-type']" size="small">
              <el-radio-button label="text">
                text
              </el-radio-button>
              <el-radio-button label="picture">
                picture
              </el-radio-button>
              <el-radio-button label="picture-card">
                picture-card
              </el-radio-button>
            </el-radio-group>
          </el-form-item>
          <el-form-item
            v-if="activeData.type !== undefined && activeData.__config__.tag === 'el-button'"
            label="按钮类型"
          >
            <el-select v-model="activeData.type" :style="{ width: '100%' }">
              <el-option label="primary" value="primary" />
              <el-option label="success" value="success" />
              <el-option label="warning" value="warning" />
              <el-option label="danger" value="danger" />
              <el-option label="info" value="info" />
              <el-option label="text" value="text" />
            </el-select>
          </el-form-item>
          <el-form-item
            v-if="activeData.__config__.buttonText !== undefined"
            v-show="'picture-card' !== activeData['list-type']"
            label="按钮文字"
          >
            <el-input v-model="activeData.__config__.buttonText" placeholder="请输入按钮文字" />
          </el-form-item>
          <el-form-item
            v-if="activeData.__config__.tag === 'el-button'"
            label="按钮文字"
          >
            <el-input v-model="activeData.__slot__.default" placeholder="请输入按钮文字" />
          </el-form-item>
          <el-form-item v-if="activeData['range-separator'] !== undefined" label="分隔符">
            <el-input v-model="activeData['range-separator']" placeholder="请输入分隔符" />
          </el-form-item>
          <el-form-item v-if="activeData['picker-options'] !== undefined" label="时间段">
            <el-input
              v-model="activeData['picker-options'].selectableRange"
              placeholder="请输入时间段"
            />
          </el-form-item>
          <el-form-item v-if="activeData.format !== undefined" label="时间格式">
            <el-input
              :value="activeData.format"
              placeholder="请输入时间格式"
              @input="setTimeValue($event)"
            />
          </el-form-item>
          <!-- <template v-if="['el-checkbox-group', 'el-radio-group', 'el-select'].indexOf(activeData.__config__.tag) > -1">
            <el-divider>选项</el-divider>
            <draggable
              :list="activeData.__slot__.options"
              :animation="340"
              group="selectItem"
              handle=".option-drag"
            >
              <div v-for="(item, index) in activeData.__slot__.options" :key="index" class="select-item">
                <div class="select-line-icon option-drag">
                  <i class="el-icon-s-operation" />
                </div>
                <el-input v-model="item.label" placeholder="选项名" size="small" />
                <el-input
                  placeholder="选项值"
                  size="small"
                  :value="item.value"
                  @input="setOptionValue(item, $event)"
                />
                <div class="close-btn select-line-icon" @click="activeData.__slot__.options.splice(index, 1)">
                  <i class="el-icon-remove-outline" />
                </div>
              </div>
            </draggable>
            <div style="margin-left: 20px;">
              <el-button
                style="padding-bottom: 0"
                icon="el-icon-circle-plus-outline"
                type="text"
                @click="addSelectItem"
              >
                添加选项
              </el-button>
            </div>
            <el-divider />
          </template> -->
          <template v-if="['my-checkbox-group', 'my-radio-group', 'my-select'].includes(activeData.__config__.tag)">
             <el-divider>选项</el-divider>
             <el-form-item v-if="activeData.dataType" label="数据类型">
               <el-radio-group v-model="activeData.dataType" size="small" @change="changeDataType">
                 <el-radio-button label="static">
                   静态数据
                 </el-radio-button>
                 <el-radio-button label="dictionary">
                   数据字典
                 </el-radio-button>
                 <el-radio-button label="datasource">
                   数据源
                 </el-radio-button>
               </el-radio-group>
             </el-form-item>
             <template v-if="activeData.dataType === 'static'">
               <draggable :list="activeData.options" :animation="340" group="selectItem" handle=".option-drag">
                 <div v-for="(item, index) in activeData.options" :key="index" class="select-item">
                   <div class="select-line-icon option-drag">
                     <i class="el-icon-s-operation" />
                   </div>
                   <el-input v-model="item.label" placeholder="选项名" size="small" />
                   <el-input placeholder="选项值" size="small" :value="item.value" @input="setOptionValue(item, $event)" />
                   <div class="close-btn select-line-icon" @click="activeData.options.splice(index, 1)">
                     <i class="el-icon-remove-outline" />
                   </div>
                 </div>
               </draggable>
               <div style="margin-left: 20px;">
                 <el-button style="padding-bottom: 0" icon="el-icon-circle-plus-outline" type="text"
                   @click="addMySelectItem">
                   添加选项
                 </el-button>
               </div>
             </template>
             <template v-else-if="activeData.dataType === 'datasource'">
               <el-form-item label="数据库表">
                 <el-select v-model="activeData.tableName" @change="changeTable">
                  <el-option v-for="item in tableOptions" :key="item.value" :label="item.label" :value="item.value"  style="width:227px;">
                  </el-option>
                 </el-select>
               </el-form-item>
               <el-form-item label="数据字段">
                 <el-select v-model="activeData.fieldName">
                   <el-option v-for="item in fieldOptions" :key="item.value" :label="item.label" :value="item.value" style="width:227px;">
                   </el-option>
                 </el-select>
               </el-form-item>
             </template>
             <template v-else>
               <el-form-item label="数据字典">
                  <el-select v-model="activeData.dictName">
                    <el-option v-for="item in dictOptions" :key="item.value" :label="item.label" :value="item.value"  style="width:227px;">
                    </el-option>
                  </el-select>
               </el-form-item>
             </template>
            <el-divider />
          </template>

          <template v-if="['my-cascader'].includes(activeData.__config__.tag)">
            <el-divider>选项</el-divider>
            <el-form-item v-if="activeData.dataType" label="数据类型">
              <el-radio-group v-model="activeData.dataType" size="small">
                <el-radio-button label="static">
                  静态数据
                </el-radio-button>
                <el-radio-button label="dynamic">
                  数据源
                </el-radio-button>
              </el-radio-group>
            </el-form-item>
           <template v-if="activeData.dataType === 'dynamic'">
             <el-button style="padding-bottom: 0" icon="el-icon-circle-plus-outline" type="text" @click="()=>{dialogDynamicVisible = true}">
               配置数据源
             </el-button>
           </template>
           <el-tree v-if="activeData.dataType === 'static'" draggable :data="activeData.options" node-key="id"
            :expand-on-click-node="false" :render-content="renderContent" />
            <div v-if="activeData.dataType === 'static'" style="margin-left: 20px">
            <el-button style="padding-bottom: 0" icon="el-icon-circle-plus-outline" type="text" @click="addTreeItem">
              添加父级
            </el-button>
          </div>
          <el-divider />
          </template>

          <!-- <template v-if="['el-cascader', 'el-table'].includes(activeData.__config__.tag)">
            <el-divider>选项</el-divider>
            <el-form-item v-if="activeData.__config__.dataType" label="数据类型">
              <el-radio-group v-model="activeData.__config__.dataType" size="small">
                <el-radio-button label="dynamic">
                  动态数据
                </el-radio-button>
                <el-radio-button label="static">
                  静态数据
                </el-radio-button>
              </el-radio-group>
            </el-form-item>

            <template v-if="activeData.__config__.dataType === 'dynamic'">
              <el-form-item label="接口地址">
                <el-input
                  v-model="activeData.__config__.url"
                  :title="activeData.__config__.url"
                  placeholder="请输入接口地址"
                  clearable
                  @blur="$emit('fetch-data', activeData)"
                >
                  <el-select
                    slot="prepend"
                    v-model="activeData.__config__.method"
                    :style="{width: '85px'}"
                    @change="$emit('fetch-data', activeData)"
                  >
                    <el-option label="get" value="get" />
                    <el-option label="post" value="post" />
                    <el-option label="put" value="put" />
                    <el-option label="delete" value="delete" />
                  </el-select>
                </el-input>
              </el-form-item>
              <el-form-item label="数据位置">
                <el-input
                  v-model="activeData.__config__.dataPath"
                  placeholder="请输入数据位置"
                  @blur="$emit('fetch-data', activeData)"
                />
              </el-form-item>

              <template v-if="activeData.props && activeData.props.props">
                <el-form-item label="标签键名">
                  <el-input v-model="activeData.props.props.label" placeholder="请输入标签键名" />
                </el-form-item>
                <el-form-item label="值键名">
                  <el-input v-model="activeData.props.props.value" placeholder="请输入值键名" />
                </el-form-item>
                <el-form-item label="子级键名">
                  <el-input v-model="activeData.props.props.children" placeholder="请输入子级键名" />
                </el-form-item>
              </template>
            </template>
            <el-tree
              v-if="activeData.__config__.dataType === 'static'"
              draggable
              :data="activeData.options"
              node-key="id"
              :expand-on-click-node="false"
              :render-content="renderContent"
            />
            <div v-if="activeData.__config__.dataType === 'static'" style="margin-left: 20px">
              <el-button
                style="padding-bottom: 0"
                icon="el-icon-circle-plus-outline"
                type="text"
                @click="addTreeItem"
              >
                添加父级
              </el-button>
            </div>
            <el-divider />
          </template> -->

          <el-form-item v-if="activeData.optionType !== undefined" label="选项样式">
            <el-radio-group v-model="activeData.optionType">
              <el-radio-button label="default">
                默认
              </el-radio-button>
              <el-radio-button label="button">
                按钮
              </el-radio-button>
            </el-radio-group>
          </el-form-item>
          <el-form-item v-if="activeData['active-color'] !== undefined" label="开启颜色">
            <el-color-picker v-model="activeData['active-color']" />
          </el-form-item>
          <el-form-item v-if="activeData['inactive-color'] !== undefined" label="关闭颜色">
            <el-color-picker v-model="activeData['inactive-color']" />
          </el-form-item>
          <!-- 子表单布局设置 -->
          <template v-if="activeData.__config__.tag==='Subform'">
             <el-divider>布局设置</el-divider>
            <el-form-item label="编辑模式" >
              <el-select v-model="activeData.__config__.editType" placeholder="选项名" size="small">
                  <el-option value='table' label='表内编辑模式'></el-option>
                  <el-option value='dialog' label='弹窗模式'></el-option>
                </el-select>
            </el-form-item>
            <el-form-item v-if="activeData.__config__.tag === 'Subform'"
              label="子表单列宽度" style="marginBottom:5px" labelWidth="115px">
              <div style='display: flex;justify-content: flex-end;margin-left: 20px'>
                <el-switch v-model="activeData.__config__.labelIsShow" style='marginTop:6px'/>
              </div>
            </el-form-item>
            <div style='marginBottom:10px' v-if='activeData.__config__.labelIsShow'>
              <el-input size="small" v-model="activeData.__config__.columnWidth" style='width:60%;padding-left: 22px;'/>
              <span style='marginLeft:10px'>px</span>
            </div>

            <el-form-item v-if="activeData.__config__.tag === 'Subform'"
              label="显示序号" style="marginBottom:5px">
              <div style='display: flex;justify-content: flex-end;margin-left: 20px'>
                <el-switch v-model="activeData.__config__.showNum" style='marginTop:6px'/>
              </div>
            </el-form-item>
            <div style='marginBottom:10px' v-if='activeData.__config__.showNum'>
              <el-input size="small" v-model="activeData.__config__.numLabel" style='width:40%;padding-left: 22px;'/>
              <el-input-number size="small" :min="0" style="marginRight:10px;margin-left: 20px"
                controls-position="right" v-model="activeData.__config__.numWidth">
              </el-input-number>px
            </div>
            <el-form-item v-if="activeData.__config__.tag === 'Subform'"
              label="自定义列" style="marginBottom:5px">
              <div style='display: flex;justify-content: flex-end'>
                <el-switch v-model="activeData.__config__.showCustomColumn" style='marginTop:6px'/>
              </div>
            </el-form-item>
          </template>
          <!-- 排序设置 -->
          <template v-if="activeData.__config__.tag === 'Subform'">
            <el-divider>排序设置</el-divider>
            <el-form-item label="排序字段">
              <el-select v-model="activeData.__config__.sortField" clearable placeholder="请选择排序字段" size="small">
                <el-option v-for="item in sortList" :key="item.__config__.formId" :label="item.__config__.label" :value="item.__config__.formId" style="width:227px;">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="排序类型">
              <el-select v-model="activeData.__config__.sortType" clearable placeholder="请选择排序类型" size="small">
                <el-option label="降序" value="desc">
                </el-option>
                <el-option label="升序" value="asc">
                </el-option>
              </el-select>
            </el-form-item>
          </template>
          <!-- 分页设置 -->
          <template v-if="activeData.__config__.tag === 'Subform'">
             <el-divider>分页设置</el-divider>
             <el-form-item
              label="是否分页" style="marginBottom:5px">
              <div style='display: flex;justify-content: flex-end'>
                <el-switch v-model="activeData.__config__.isPage" style='marginTop:6px'/>
              </div>
            </el-form-item>
             <el-form-item v-if="activeData.__config__.isPage"
              label="分页条数">
                <el-radio-group v-model="activeData.__config__.pageSize">
                  <el-radio-button label=10></el-radio-button>
                  <el-radio-button label=20></el-radio-button>
                  <el-radio-button label=30></el-radio-button>
                  <el-radio-button label=50></el-radio-button>
                </el-radio-group>
            </el-form-item>
          </template>
          <!-- 固定列 -->
          <template v-if="activeData.__config__.tag === 'Subform'">
             <el-divider>固定列</el-divider>
            <el-form-item label="左固定列">
            <el-input-number :min="0" v-model="activeData.__config__.leftCol" size="small" style="marginRight:10px;"
              controls-position="right"></el-input-number>列
          </el-form-item>
          <el-form-item label="右固定列">
            <el-input-number :min="0" v-model="activeData.__config__.rightCol" size="small" style="marginRight:10px;"
              controls-position="right">
            </el-input-number>列
          </el-form-item>
          </template>
          <el-form-item v-if="activeData.__config__.titleRap !== undefined
            && activeData.__config__.labelWidth !== undefined" label="显示标签"
           >
            <div style='display: flex;justify-content: flex-end'>
                <el-switch v-model="activeData.__config__.showLabel" style='marginTop:6px'/>
              </div>
          </el-form-item>
          <el-form-item v-if="activeData.__config__.tag === 'Subform'" label="标题是否换行"
           label-width="117px">
            <div style='display: flex;justify-content: flex-end'>
                <el-switch v-model="activeData.__config__.titleRap" style='marginTop:6px'/>
              </div>
          </el-form-item>
          <el-form-item v-if="activeData.__config__.tag === 'Subform'" label="是否显示组件边框"
           label-width="145px">
            <div style='display: flex;justify-content: flex-end'>
                <el-switch v-model="activeData.__config__.componentBorder" style='marginTop:6px'/>
              </div>
          </el-form-item>
          <el-form-item v-if="activeData.__config__.tag === 'Subform'" label="是否显示子表单边框"
           label-width="145px">
            <div style='display: flex;justify-content: flex-end'>
                <el-switch v-model="activeData.__config__.formBorder" style='marginTop:6px'/>
              </div>
          </el-form-item>
          <el-form-item v-if="activeData.branding !== undefined" label="品牌烙印">
            <el-switch v-model="activeData.branding" @input="changeRenderKey" />
          </el-form-item>
          <el-form-item v-if="activeData['allow-half'] !== undefined" label="允许半选">
            <el-switch v-model="activeData['allow-half']" />
          </el-form-item>
          <el-form-item v-if="activeData['show-text'] !== undefined" label="辅助文字">
            <el-switch v-model="activeData['show-text']" @change="rateTextChange" />
          </el-form-item>
          <el-form-item v-if="activeData['show-score'] !== undefined" label="显示分数">
            <el-switch v-model="activeData['show-score']" @change="rateScoreChange" />
          </el-form-item>
          <el-form-item v-if="activeData['show-stops'] !== undefined" label="显示间断点">
            <el-switch v-model="activeData['show-stops']" />
          </el-form-item>
          <el-form-item v-if="activeData.range !== undefined" label="范围选择">
            <el-switch v-model="activeData.range" @change="rangeChange" />
          </el-form-item>
          <el-form-item
            v-if="activeData.__config__.border !== undefined && activeData.__config__.optionType === 'default'"
            label="是否带边框"
          >
            <el-switch v-model="activeData.__config__.border" />
          </el-form-item>
          <el-form-item v-if="activeData.__config__.tag === 'el-color-picker'" label="颜色格式">
            <el-select
              v-model="activeData['color-format']"
              placeholder="请选择颜色格式"
              :style="{ width: '100%' }"
              clearable
              @change="colorFormatChange"
            >
              <el-option
                v-for="(item, index) in colorFormatOptions"
                :key="index"
                :label="item.label"
                :value="item.value"
              />
            </el-select>
          </el-form-item>
          <el-form-item
            v-if="activeData.size !== undefined &&
              (activeData.__config__.optionType === 'button' ||
                activeData.__config__.border ||
                activeData.__config__.tag === 'el-color-picker' ||
                activeData.__config__.tag === 'el-button')"
            label="组件尺寸"
          >
            <el-radio-group v-model="activeData.size">
              <el-radio-button label="medium">
                中等
              </el-radio-button>
              <el-radio-button label="small">
                较小
              </el-radio-button>
              <el-radio-button label="mini">
                迷你
              </el-radio-button>
            </el-radio-group>
          </el-form-item>
          <el-form-item v-if="activeData['show-word-limit'] !== undefined" label="输入统计">
            <el-switch v-model="activeData['show-word-limit']" />
          </el-form-item>
          <el-form-item v-if="activeData.__config__.tag === 'el-input-number'" label="严格步数">
            <el-switch v-model="activeData['step-strictly']" />
          </el-form-item>
          <el-form-item v-if="activeData.__config__.tag === 'el-cascader'||activeData.__config__.tag === 'my-cascader' || activeData.__config__.tag === 'my-region'"
            label="任选层级">
            <el-switch v-model="activeData.props.props.checkStrictly" />
          </el-form-item>
          <el-form-item v-if="activeData.__config__.tag === 'el-cascader'||activeData.__config__.tag === 'my-cascader' || activeData.__config__.tag === 'my-region'"
            label="是否多选">
            <el-switch v-model="activeData.props.props.multiple" />
          </el-form-item>
          <el-form-item v-if="activeData.__config__.manyCheck"
            label="是否多选">
            <el-switch v-model="activeData.multiple" />
          </el-form-item>
          <el-form-item v-if="activeData.__config__.tag === 'el-cascader'||activeData.__config__.tag === 'my-cascader'|| activeData.__config__.tag === 'my-region'"
            label="展示全路径">
            <el-switch v-model="activeData['show-all-levels']" />
          </el-form-item>
          <el-form-item v-if="activeData.__config__.tag === 'el-cascader'||activeData.__config__.tag === 'my-cascader'|| activeData.__config__.tag === 'my-region'"
            label="可否筛选">
            <el-switch v-model="activeData.filterable" />
          </el-form-item>
          <el-form-item v-if="activeData.displayLabel !== undefined" label="显示标签">
            <el-switch v-model="activeData.__config__.showLabel" />
          </el-form-item>
          <el-form-item v-if="activeData.clearable !== undefined" label="能否清空">
            <el-switch v-model="activeData.clearable" />
          </el-form-item>
          <el-form-item v-if="activeData.__config__.showTip !== undefined" label="显示提示">
            <el-switch v-model="activeData.__config__.showTip" />
          </el-form-item>
          <el-form-item v-if="activeData.__config__.tag === 'el-upload'" label="多选文件">
            <el-switch v-model="activeData.multiple" />
          </el-form-item>
          <el-form-item v-if="activeData['auto-upload'] !== undefined" label="自动上传">
            <el-switch v-model="activeData['auto-upload']" />
          </el-form-item>
          <el-form-item v-if="activeData.readonly !== undefined && activeData.__config__.tag !=='tinymce'" label="是否只读">
            <el-switch v-model="activeData.readonly" @input="changeRenderKey"/>
          </el-form-item>
          <el-form-item v-if="activeData.disabled !== undefined && activeData.__config__.tag !=='tinymce'" label="是否禁用">
            <el-switch v-model="activeData.disabled" @input="changeRenderKey"/>
          </el-form-item>
          <template v-if="activeData.__config__.tag ==='tinymce'">
            <el-form-item v-if="activeData.disabled !== undefined" label="是否只读">
              <el-switch v-model="activeData.disabled" @input="changeRenderKey"/>
            </el-form-item>
            <el-form-item v-if="activeData.readonly !== undefined" label="是否禁用">
              <el-switch v-model="activeData.readonly" @input="changeRenderKey"/>
            </el-form-item>
          </template>
          <el-form-item v-if="activeData.__config__.tag === 'my-select'" label="能否搜索">
            <el-switch v-model="activeData.filterable" />
          </el-form-item>
          <el-form-item v-if="activeData.__config__.tag === 'my-select'" label="是否多选">
            <el-switch v-model="activeData.multiple" @change="multipleChange" />
          </el-form-item>
          <el-form-item v-if="activeData.__config__.required !== undefined" label="是否必填">
            <el-switch v-model="activeData.__config__.required" />
          </el-form-item>

          <!-- 选项卡 -->
          <template v-if="['el-tabs'].indexOf(activeData.__config__.tag) > -1">
            <el-divider>选项</el-divider>
              <draggable
                :list="activeData.__slot__.options"
                :animation="340"
                group="tabsItem"
                handle=".option-drag"
              >
                <div v-for="(item, index) in activeData.__slot__.options" :key="index" class="tabs-item">
                  <div class="tabs-line-icon option-drag">
                    <i class="el-icon-s-operation" />
                  </div>
                  <el-input v-model="item.label" placeholder="选项名" size="small" />
                  <div class="close-btn tabs-line-icon" @click="activeData.__slot__.options.splice(index, 1)">
                    <i class="el-icon-remove-outline" />
                  </div>
                </div>
              </draggable>
            <div style="margin-left: 20px;">
              <el-button style="padding-bottom: 0" icon="el-icon-circle-plus-outline" type="text" @click="addTab">
                添加选项
              </el-button>
            </div>
            <el-divider />
          </template>
          <!-- 折叠面板选项卡 -->
          <template v-if="['el-collapse'].indexOf(activeData.__config__.tag) > -1">
            <el-divider>选项</el-divider>
              <draggable
                :list="activeData.__slot__.options"
                :animation="340"
                group="collapseItem"
                handle=".option-drag"
              >
                <div v-for="(item, index) in activeData.__slot__.options" :key="index" class="tabs-item">
                  <div class="tabs-line-icon option-drag">
                    <i class="el-icon-s-operation" />
                  </div>
                  <el-input v-model="item.title" placeholder="折叠面板" size="small" />
                  <div class="close-btn tabs-line-icon" @click="activeData.__slot__.options.splice(index, 1)">
                    <i class="el-icon-remove-outline" />
                  </div>
                </div>
              </draggable>
            <div style="margin-left: 20px;">
              <el-button style="padding-bottom: 0" icon="el-icon-circle-plus-outline" type="text" @click="addCollapse">
                添加选项
              </el-button>
            </div>
            <el-divider />
          </template>
          <template v-if="['Steps'].indexOf(activeData.__config__.tag) > -1">
            <el-form-item label="标签配置" label-width="70px" />
            <draggable :list="activeData['options']" :animation="340" group="selectItem" handle=".option-drag">
              <div v-for="(item, index) in activeData['options']" :key="index" class="select-item">
                <div class="select-line-icon option-drag">
                  <i class="el-icon-s-operation" />
                </div>
                <el-input v-model="item.label" placeholder="选项名" size="small" />
                <div class="close-btn select-line-icon" @click="removeOption(index)">
                  <i class="el-icon-remove-outline" />
                </div>
              </div>
            </draggable>
            <div style="margin-left: 20px;">
              <el-button
                style="padding-bottom: 0"
                icon="el-icon-circle-plus-outline"
                type="text"
                @click="addSelectItem"
              >
                添加选项
              </el-button>
            </div>
          <el-divider />
          </template>
          <!-- 按钮配置 -->
          <template v-if="activeData.__config__.tag==='Steps'">
            <el-form-item label="步骤条按钮配置" label-width="110px" />
            <el-form-item label="上一步按钮">
              <el-input v-model="activeData.__config__.up" placeholder="选项名" size="small" />
            </el-form-item>
            <el-form-item label="下一步按钮">
              <el-input v-model="activeData.__config__.down" placeholder="选项名" size="small" />
            </el-form-item>
            <el-form-item label="关闭/完成">
              <el-input v-model="activeData.__config__.finish" placeholder="选项名" size="small" />
            </el-form-item>
          </template>
          <!-- 选项卡-风格类型 -->
          <el-form-item v-if="activeData.__config__.tag === 'el-tabs'" label="风格类型">
            <el-radio-group v-model="activeData.type">
              <el-radio-button label="">
                默认
              </el-radio-button>
              <el-radio-button label="card">
                选项卡
              </el-radio-button>
              <el-radio-button label="border-card">
                卡片化
              </el-radio-button>
            </el-radio-group>
          </el-form-item>
          <!-- 选项卡-选项卡位置 -->
          <el-form-item v-if="activeData.__config__.tag === 'el-tabs'" label="选项卡位置">
            <el-radio-group v-model="activeData['tab-position']">
              <el-radio-button label="top">
                顶部
              </el-radio-button>
              <el-radio-button label="left">
                左侧
              </el-radio-button>
              <el-radio-button label="right">
                右侧
              </el-radio-button>
              <el-radio-button label="bottom">
                底部
              </el-radio-button>
            </el-radio-group>
          </el-form-item>

          <template v-if="activeData.__config__.layoutTree">
            <el-divider>布局结构树</el-divider>
            <el-tree
              :data="[activeData.__config__]"
              :props="layoutTreeProps"
              node-key="renderKey"
              default-expand-all
              draggable
            >
              <span slot-scope="{ node, data }">
                <span class="node-label">
                  <svg-icon class="node-icon" :icon-class="data.__config__?data.__config__.tagIcon:data.tagIcon" />
                  {{ node.label }}
                </span>
              </span>
            </el-tree>
          </template>
          <!-- <template v-if="Array.isArray(activeData.__config__.regList)"> -->
          <template v-if="activeData.__config__.tag === 'el-input' && !activeData.__config__.name">
            <el-divider>正则校验</el-divider>
            <div
              v-for="(item, index) in activeData.__config__.regList"
              :key="index"
              class="reg-item"
            >
              <span class="close-btn" @click="activeData.__config__.regList.splice(index, 1)">
                <i class="el-icon-close" />
              </span>
              <el-form-item label="表达式">
                <el-input v-model="item.pattern" placeholder="请输入正则" />
              </el-form-item>
              <el-form-item label="错误提示" style="margin-bottom:0">
                <el-input v-model="item.message" placeholder="请输入错误提示" />
              </el-form-item>
            </div>
            <!-- <div style="margin-left: 20px">
              <el-button icon="el-icon-circle-plus-outline" type="text" @click="addReg">
                添加规则
              </el-button>
            </div> -->
             <div style="margin-top:20px;">
               <el-select placeholder="请选择常用规则" clearable @change="addDefaultReg" style="margin-right:20px;" value="">
                 <el-option v-for="item in defaultRules" :key="item.value" :label="item.label" :value="item.value">
                 </el-option>
               </el-select>
               <el-button icon="el-icon-circle-plus-outline" type="text" @click="addReg">
                 添加规则
               </el-button>
             </div>
          </template>
        </el-form>
        <!-- 表单属性 -->
        <el-form v-show="currentTab === 'form'" size="small" label-width="90px">
          <el-form-item label="表单名">
            <el-input v-model="formConf.formRef" placeholder="请输入表单名（ref）" />
          </el-form-item>
          <el-form-item label="表单类型">
            <el-select
              v-model="formConf.formType"
              placeholder="请选择表单类型"
              :style="{ width: '100%' }"
              clearable
            >
              <el-option label="弹出窗口" value="msgBox" />
              <el-option label="跳转页面" value="page" />
            </el-select>
          </el-form-item>
          <template v-if="formConf.formType==='msgBox'" >
            <el-form-item label="弹窗宽度">
              <el-input-number placeholder="请输入宽度" v-model="formConf.dialogWidth" size="small" :min="50" style="width:90%;"></el-input-number>
              px
            </el-form-item>
            <el-form-item label="距顶高度">
              <el-input-number placeholder="请输入高度" v-model="formConf.dialogTop" size="small" style="width:90%;"></el-input-number>
              px
            </el-form-item>
          </template>
          <el-form-item label="表单模型">
            <el-input v-model="formConf.formModel" placeholder="请输入数据模型" />
          </el-form-item>
          <el-form-item label="校验模型">
            <el-input v-model="formConf.formRules" placeholder="请输入校验模型" />
          </el-form-item>
          <el-form-item label="表单尺寸">
            <el-radio-group v-model="formConf.size">
              <el-radio-button label="medium">
                中等
              </el-radio-button>
              <el-radio-button label="small">
                较小
              </el-radio-button>
              <el-radio-button label="mini">
                迷你
              </el-radio-button>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="标签对齐">
            <el-radio-group v-model="formConf.labelPosition">
              <el-radio-button label="left">
                左对齐
              </el-radio-button>
              <el-radio-button label="right">
                右对齐
              </el-radio-button>
              <el-radio-button label="top">
                顶部对齐
              </el-radio-button>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="标签描述位置">
            <el-radio-group v-model="formConf.labelDescriptionPosition">
              <el-radio-button label="icon">
                标签图标
              </el-radio-button>
              <el-radio-button label="button">
                底部一行
              </el-radio-button>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="标签宽度">
            <el-input v-model.number="formConf.labelWidth" type="number" placeholder="请输入标签宽度" />
          </el-form-item>
          <el-form-item label="栅格间隔">
            <el-input-number v-model="formConf.gutter" :min="0" placeholder="栅格间隔" />
          </el-form-item>
          <el-form-item label="禁用表单">
            <el-switch v-model="formConf.disabled" />
          </el-form-item>
          <el-form-item label="表单按钮">
            <el-switch v-model="formConf.formBtns" />
          </el-form-item>
          <template v-if="formConf.formBtns">
            <el-divider>按钮配置</el-divider>
            <el-form-item label="表单按钮 :" style='marginBottom:2px'></el-form-item>
              <div v-for="(item, index) in formConf.btnConfig.filter(item=>item.label!=='保存')" :key="index" class="select-item">
                <el-checkbox v-model="item.checked" style="marginLeft:10px;">{{item.label}}
                <el-input v-model="item.text" placeholder="按钮名" size="small" style="width:100px;marginRight:10px;marginLeft:10px;"/>
                </el-checkbox>
                <el-select v-model="item.type" style="width:100px">
                  <el-option v-for="(opt, index) in btnStyles" :label="opt.label" :value="opt.value" :key="index">
                    <el-link :type="opt.value" :underline="false">{{opt.label}}</el-link>
                  </el-option>
                </el-select>
              </div>
             <!-- <el-form-item  label="按钮位置" style="marginTop:20px;">
               <el-radio-group v-model="formConf.btnPosition">
                 <el-radio-button label="left">
                   左对齐
                 </el-radio-button>
                 <el-radio-button label="center">
                   居中
                 </el-radio-button>
                 <el-radio-button label="right">
                   右对齐
                 </el-radio-button>
               </el-radio-group>
             </el-form-item> -->
          </template>
          <template>
            <el-form-item label="表单规则" style='marginBottom:2px'><span style="float:right;color:#409eff;cursor:pointer;" @click="editFormRule">添加规则</span>
            </el-form-item>
            <div style="minHeight:100px;border:1px solid #DCDFE6;margin:0px 0px 10px 20px;">
              <draggable v-if="formConf.ruleConfig&&formConf.ruleConfig.length > 0" :list="formConf.ruleConfig" :animation="340" group="selectBtn" handle=".option-drag">
                <div v-for="(item, index) in formConf.ruleConfig" :key="index" style="display:flex;alignItems:center;fontSize:14px;padding:5px;justifyContent:space-between">
                  <div style="width:24%;">批次:{{item.basic.order}}</div>
                  <div style="width:50%;overflow:hidden;whiteSpace:nowrap;textOverflow:ellipsis;">名称:{{item.basic.name}}</div>
                  <div style="width:24%;">
                    <i class="el-icon-setting" style="padding:0 5px;" @click="editFormRule(item,index)" />
                    <i class="el-icon-delete" style="padding:0 5px;" @click="()=>{formConf.ruleConfig.splice(index,1)}" />
                    <i class="el-icon-rank  option-drag" style="paddingLeft:5px;" />
                  </div>
                </div>
              </draggable>
               <div v-else style="textAlign:center;lineHeight:100px;">暂无规则</div>
            </div>
          </template>
          <el-form-item label="显示未选中组件边框">
            <el-switch v-model="formConf.unFocusedComponentBorder" />
          </el-form-item>
        </el-form>
      </el-scrollbar>
    </div>
    <el-dialog title="设置按钮" :visible.sync="btnSettingVisible" width="600px">
      <el-form :model="btnSetting" label-width="80px">
        <el-form-item label="按钮名称" :rules="[{required:true,message:'请输入按钮名称',trigger:'blur'}]">
          <el-input v-model="btnSetting.text" placeholder="按钮名" size="small" />
        </el-form-item>
        <el-form-item label="按钮位置" :rules="[{required:true,message:'请选择按钮位置',trigger:'blur'}]">
          <el-radio-group v-model="btnSetting.position" :disabled="btnSetting.label==='批量删除'">
            <el-radio-button label="table" :disabled='btnSetting.onlyInline'>表格操作</el-radio-button>
            <el-radio-button label="inline" :disabled='btnSetting.onlyTable'>行内操作</el-radio-button>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="按钮颜色" :rules="[{required:true,message:'请选择按钮颜色',trigger:'blur'}]">
          <el-select v-model="btnSetting.type" style="width:100%" size="small">
            <el-option v-for="(opt, index) in btnStyles" :label="opt.label" :value="opt.value" :key="index">
              <el-link :type="opt.value" :underline="false">{{opt.label}}</el-link>
            </el-option>
          </el-select>
        </el-form-item>
      </el-form>
    </el-dialog>
    <treeNode-dialog :visible.sync="dialogVisible" title="添加选项" @commit="addNode" />
    <icons-dialog :visible.sync="iconsVisible" :current="activeData[currentIconModel]" @select="setIcon" />
    <dynamic-datasource-dialog v-if="dialogDynamicVisible" @close="()=>{dialogDynamicVisible=false}" @commit="addLevelNode"
      :fields="activeData.fields" :formName="activeData.formName">
    </dynamic-datasource-dialog>
    <rule-config-dialog ref="ruleDialog" v-if="formRuleVisible" :fields="fields" @commit="addFormRule" @update="updateFormRule" @close="()=>{formRuleVisible = false}"></rule-config-dialog>
  </div>
</template>

<script>
import { isArray, log } from 'util'
import TreeNodeDialog from './TreeNodeDialog'
import DynamicDatasourceDialog from './DynamicDatasourceDialog'
import RuleConfigDialog from './RuleConfigDialog'
import { isNumberStr } from '@/utils/index'
import IconsDialog from './IconsDialog'
import {
  inputComponents, selectComponents, layoutComponents,organizationComponents
} from './config'
import { saveFormConf } from '@/utils/db'
import draggable from 'vuedraggable'
import {find} from 'lodash'
import {getAllFormName,getTableColumn,getDictName} from '@/api/custom/formDesigner'
import {getTableData,getTableAllData,getTableFields} from "@/api/custom/lenovoPopup.js";
import path from 'path';
import {toChineseNum} from '@/utils/toChineseNum'
import {
  getMainList,
  getAutomaticCode
} from "@/api/custom/autoCoding";
const dateTimeFormat = {
  date: 'yyyy-MM-dd',
  week: 'yyyy 第 WW 周',
  month: 'yyyy-MM',
  year: 'yyyy',
  datetime: 'yyyy-MM-dd HH:mm:ss',
  daterange: 'yyyy-MM-dd',
  monthrange: 'yyyy-MM',
  datetimerange: 'yyyy-MM-dd HH:mm:ss'
}
const defaultRules = [
  {label: '手机号码',value:'phone'},
  {label:'邮箱',value:'email'},
  {label:'身份证号',value:'idcard'},
  {label:'汉字',value:'hanzi'},
  {label:'数字',value:'num'},
  {label:'整数',value:'int'},
  {label:'浮点数',value:'decimal'},
  {label:'URL',value:'url'}
  ]
const defaultRulesItem ={
  phone:{pattern:'/^1(3|4|5|7|8|9)\\d{9}$/',message:'请输入大陆手机号'},
  email:{pattern:'/^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\.\\w+([-.]\\w+)*$/',message:'请输入邮箱地址'},
  idcard:{pattern:'/(^\\d{18}$)|(^\\d{17}(\\d|X|x)$)/',message:'请输入身份证号'},
  hanzi:{pattern:'/^[\\u4e00-\\u9fa5]{0,}$/',message:'请输入汉字'},
  num:{pattern:'/^\\d*$/',message:'请输入数字'},
  int:{pattern:'/^-?[1-9]\\d*|0$/ ',message:'请输入整数'},
  double:{pattern:'/^-?([1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*|0?\\.0+|0)$/',message:'请输入浮点数'},
  decimal:{pattern:'/^-?([1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*|0?\\.0+|0)$/',message:'请输入浮点数'},
  url:{pattern:'/^[a-zA-Z]+:[/]{2}\\S*$/',message:'请输入URL'}
}
// 使changeRenderKey在目标组件改变时可用
const needRerenderList = ['tinymce','signature']

export default {
  components: {
    TreeNodeDialog,
    IconsDialog,
    draggable,
    DynamicDatasourceDialog,
    RuleConfigDialog
  },
  props: ['showField', 'activeData', 'formConf','fields'],
  data() {
    return {
      currentTab: 'field',
      currentNode: null,
      dialogVisible: false,
      dialogDynamicVisible: false,
      iconsVisible: false,
      currentIconModel: null,
      defaultRules: defaultRules,
      tableOptions: [], //数据库表
      fieldOptions: [], //数据字段
      dictOptions: [], //字典
      allTables: [], //数据库表
      tableColumns: [], //数据字段
      // dictNames: [], //字典
      dateTypeOptions: [
        {
          label: '日(date)',
          value: 'date'
        },
        {
          label: '周(week)',
          value: 'week'
        },
        {
          label: '月(month)',
          value: 'month'
        },
        {
          label: '年(year)',
          value: 'year'
        },
        {
          label: '日期时间(datetime)',
          value: 'datetime'
        }
      ],
      dateRangeTypeOptions: [
        {
          label: '日期范围(daterange)',
          value: 'daterange'
        },
        {
          label: '月范围(monthrange)',
          value: 'monthrange'
        },
        {
          label: '日期时间范围(datetimerange)',
          value: 'datetimerange'
        }
      ],
      btnConfig : {
        insert: {
          label: '添加',
          text: '添加',
          method: 'insertData',
          position: 'table',
          type: 'primary',
          onlyTable:true,
          command:"insert"
        },
        del: {
          label: '删除',
          text: '删除',
          method: 'delData',
          position: 'inline',
          iconType: 'el-icon-delete',
          type: 'danger',
          command:"del"
        },
        // view: {
        //   label: '查看',
        //   text: '查看',
        //   method: 'viewData',
        //   position: 'inline',
        //   type: 'primary'
        // },
        edit: {
          label: '编辑',
          text: '编辑',
          method: 'editData',
          position: 'inline',
          type: 'primary',
          iconType: 'el-icon-edit',
          onlyInline:true,
          circle: 'circle',
          command:"edit"
        },

        copyData: {
          label: '复制',
          text: '复制',
          method: 'copyData',
          position: 'inline',
          type: 'primary',
          onlyInline:true,
          iconType: 'el-icon-document-copy',
          command:"copyData"
        },
        import: {
          label: '导入',
          text: '快速导入',
          method: '',
          position: 'table',
          type: 'default',
          onlyTable:true,
          command:"import"
        },
        export: {
          label: '导出',
          text: '快速导出',
          method: 'exportToExcel',
          position: 'table',
          type: 'default',
          onlyTable:true,
          command:"export"
        },
        moveUp: {
          label: '上移',
          text: '上移',
          method: 'approvalData',
          position: 'inline',
          type: 'primary',
          onlyInline:true,
          circle: 'circle',
          iconType: 'el-icon-top',
          command:"moveUp"
        },
        moveDown: {
          label: '下移',
          text: '下移',
          method: 'multiDel',
          position: 'inline',
          type: 'primary',
          onlyInline:true,
          circle: 'circle',
          iconType: 'el-icon-bottom',
          command:"moveDown"
        }
      },
      colorFormatOptions: [
        {
          label: 'hex',
          value: 'hex'
        },
        {
          label: 'rgb',
          value: 'rgb'
        },
        {
          label: 'rgba',
          value: 'rgba'
        },
        {
          label: 'hsv',
          value: 'hsv'
        },
        {
          label: 'hsl',
          value: 'hsl'
        }
      ],
      justifyOptions: [
        {
          label: 'start',
          value: 'start'
        },
        {
          label: 'end',
          value: 'end'
        },
        {
          label: 'center',
          value: 'center'
        },
        {
          label: 'space-around',
          value: 'space-around'
        },
        {
          label: 'space-between',
          value: 'space-between'
        }
      ],
      defaultSelectOptions:[
        {
          label: '固定值',
          value: 'stickValue'
        },
        {
          label: '预设值',
          value: 'presetValue'
        },
      ],
      PresetContent:[
        {
          label:'用户',
          content:'当前用户'
        },
        {
          label:'部门',
          content:'当前部门'
        },
        {
          label:'岗位',
          content:'当前岗位'
        },
      ],
      btnStyles: [{
      label: '默认',
      value: 'default'
      },
      {
      label: '主要',
      value: 'primary'
      },
      {
      label: '成功',
      value: 'success'
      },
       {
      label: '信息',
      value: 'info'
      },
      {
      label: '警告',
      value: 'warning'
      },
      {
      label: '危险',
      value: 'danger'
      },

      ],
      layoutTreeProps: {
        label(data, node) {
          const config = data.__config__
          return data.componentName || (config && `${config.label}: ${data.__vModel__}`)
        }
      },
      rulesArray:[],
      btnSettingVisible: false,
      btnSetting: {},
      formRuleVisible: false
    }
  },
  mounted(){
    console.log(this.activeData)
    getMainList({pageNo:1,pageSize:49,encodeName:''}).then((res)=>{
      this.rulesArray=res.data.list
    })
  },
  computed: {
    documentLink() {
      return (
        this.activeData.__config__.document
        || 'https://element.eleme.cn/#/zh-CN/component/installation'
      )
    },
    sortList(){
      return this.activeData.__config__.children[0].__config__.children
    },
    dateOptions() {
      if (
        this.activeData.type !== undefined
        && this.activeData.__config__.tag === 'el-date-picker'
      ) {
        if (this.activeData['start-placeholder'] === undefined) {
          return this.dateTypeOptions
        }
        return this.dateRangeTypeOptions
      }
      return []
    },
    tagList() {
      return [
        {
          label: '输入型组件',
          options: inputComponents
        },
        {
          label: '选择型组件',
          options: selectComponents
        },
        {
          label: '布局型组件',
          options: layoutComponents
        },
        {
          label: '组织结构组件',
          options: organizationComponents
        }
      ]
    },
    activeTag() {
      return this.activeData.__config__.tag
    },
    isShowMin() {
      return ['el-input-number', 'el-slider'].indexOf(this.activeTag) > -1
    },
    isShowMax() {
      return ['el-input-number', 'el-slider', 'el-rate'].indexOf(this.activeTag) > -1
    },
    isShowStep() {
      return ['el-input-number', 'el-slider'].indexOf(this.activeTag) > -1
    }
  },
  watch: {
    formConf: {
      handler(val) {
        saveFormConf(val)
      },
      deep: true
    },
    'activeData.__vModel__': {
      handler(val) {
        if (this.activeData.dictName&&this.activeData.dictName!=='') {
          this.getDictList()
        }
        if(this.activeData.dataType&&this.activeData.dataType==='datasource'){
          this.getTableName()
          this.getAllTableName()
          if (this.activeData.tableName&&this.activeData.tableName !== ''){
            this.getFieldName(this.activeData.tableName)
          }
        }
      },
      immediate: true
    },
  },
  methods: {
    changePlaceholder(val) {
      let isInput = inputComponents.filter((item)=>{
       return item.__config__.tag === this.activeData.__config__.tag
      })
      if (isInput.length > 0) {
        this.activeData.placeholder = `请输入${val}`
      } else {
        this.activeData.placeholder = `请选择${val}`
      }
    },
    hideBtn(val){
      if(find(this.activeData.options,{label:val.label})) return true
      return false
    },
     setBtn(item) {
        this.btnSetting = item
        this.btnSettingVisible = true
      },
     addOptionBtn(e){
      this.activeData.options.push(
         {...this.btnConfig[e]}
      )
      let arr=[]
      for(let btn in this.btnConfig){
        this.activeData.options.forEach(item1=>{
          if(this.btnConfig[btn].label===item1.label){
            arr.push(item1)
          }
        })
      }
      this.activeData.options=arr
    },
    changeRulesValue(val){
      getAutomaticCode(val).then((res)=>{
       if(res.code===0) this.activeData.__config__.defaultValue=res.data
       this.activeData.disabled = true;
      })
    },
    removeOption(index) {
      if (this.activeData.options.length > 2) {
        this.activeData.options.splice(index, 1)
        this.activeData.__config__.children.splice(index, 1)
         this.$store.commit('CHANGE_STEPS',{key:this.activeData.activeId,value:index-1})
      } else {
        this.$message({
          message: '步骤数不能小于2',
          type: 'warning'
        })
      }
    },
    removeBtnOption(index){
      this.activeData.options.splice(index, 1)
    },
    defaultValueChange(val){
      this.activeData.defaultValueKey=val
      this.activeData.defaultKey=val
    },
    defaultBtn(){
      this.activeData.dialogIsShow=true
      setTimeout(()=>{
        this.activeData.dialogIsShow=false
      },1000)
      this.$refs.selectBox.blur()
    },
// import {getTableData,getTableAllData,getTableFields} from "@/api/custom/lenovoPopup.js";
    // 联想弹窗获取所有表名
    getAllTableName(){
      getTableData().then((res)=>{
        if(res.code===0){
          this.allTables=res.data.map(item=>{
            return {
              label:item,
              value:item
            }
          })
        }
      })
    },
    getTableFields(name){
      getTableFields(name).then(res=>{
        this.tableColumns=res.data.map(item=>{
          return {
            label:item.column,
            value:item.column
          }
        })
      })
    },
    getTableName() {
      getAllFormName().then((res) => {
        if (res.code === 0) {
          this.tableOptions = res.data.map((item)=>{
            return {
              label:item.formName,
              value:item.tableName
            }
          })
        }
      }).catch(e=>console.log(e))
    },
    getFieldName(name) {
      getTableColumn({tableName: name}).then((res) => {
        if (res.code === 0) {
          this.fieldOptions = res.data.map((item) => {
            return {label:item.column,value:item.columnName}
          })
        }
      }).catch(e=>console.log(e))
    },
    getDictList() {
      getDictName().then((res) => {
        if (res.code === 0) {
          this.dictOptions = res.data.map((item) => {
          return {
            label: item.name,
            value: item.type
          }
        })
        }
      }).catch(e=>console.log(e))
    },
    changeDataType(val) {
       if (val === 'dictionary') {
         this.getDictList()
       } else if (val === 'datasource') {
         this.getTableName()
         if (this.activeData.tableName !== '') {
            this.getFieldName(this.activeData.tableName)
         }
       }
    },
    changeTableDataType(val){
       if (val === 'dictionary') {
        //  this.getDictList()
       } else if (val === 'datasource') {
         this.getAllTableName()
       }
    },
    changeTable(val){
       this.getFieldName(val)
    },
    changeTableName(val){
      this.getTableFields(val)
    },
    addReg() {
      this.activeData.__config__.regList.push({
        pattern: '',
        message: ''
      })
    },
    addDefaultReg(val) {
      this.activeData.__config__.regList.push(defaultRulesItem[val])
    },
    addSelectItem() {
        this.activeData.options.push({
          label: '',
          value: ''
        })
        this.activeData.__config__.children.push(
          {
            __config__: {
              layout: 'rowFormItem',
              tagIcon: 'row',
              label: '行容器',
              layoutTree: false,
              document: 'https://element.eleme.cn/#/zh-CN/component/layout#row-attributes',
            },
            type: 'default',
            justify: 'start',
            align: 'top',
            componentName: 'el-row',
            itemBtns: false
          }
        )
       this.$emit('transStep', this.activeData)
    },
    addMySelectItem() {
      this.activeData.optionMax ++
      this.activeData.options.push({
        label: `选项${toChineseNum(this.activeData.optionMax)}`,
        value: this.activeData.optionMax
      })
    },
    addTreeItem() {
      ++this.idGlobal
      this.dialogVisible = true
      this.currentNode = this.activeData.options
    },
    renderContent(h, { node, data, store }) {
      return (
        <div class="custom-tree-node">
          <span>{node.label}</span>
          <span class="node-operation">
            <i on-click={() => this.append(data)}
              class="el-icon-plus"
              title="添加"
            ></i>
            <i on-click={() => this.remove(node, data)}
              class="el-icon-delete"
              title="删除"
            ></i>
          </span>
        </div>
      )
    },
    append(data) {
      if (!data.children) {
        this.$set(data, 'children', [])
      }
      this.dialogVisible = true
      this.currentNode = data.children
    },
    remove(node, data) {
      this.activeData.__config__.defaultValue = [] // 避免删除时报错
      const { parent } = node
      const children = parent.data.children || parent.data
      const index = children.findIndex(d => d.id === data.id)
      children.splice(index, 1)
    },
    addNode(data) {
      this.currentNode.push(data)
    },
    addLevelNode(data,formName) {
      this.activeData.fields = data
      this.activeData.formName = formName
    },
    editFormRule(data,index) {
      this.formRuleVisible = true
      this.$nextTick(()=>{
        this.$refs.ruleDialog.init(data,index)
      })
    },
    addFormRule(basic,formrule,method,config) {
      this.formConf.ruleConfig.push({
        basic,formrule,method,hide:config.hide,show:config.show
      })
    },
    updateFormRule(basic,formrule,method,config,index) {
      this.formConf.ruleConfig[index] = {
        basic,formrule,method,hide:config.hide,show:config.show
      }
    },
    setOptionValue(item, val) {
      item.value = isNumberStr(val) ? +val : val
    },
    setDefaultValue(val) {
      if (Array.isArray(val)) {
        return val.join(',')
      }
      // if (['string', 'number'].indexOf(typeof val) > -1) {
      //   return val
      // }
      if (typeof val === 'boolean') {
        return `${val}`
      }
      return val
    },
    onDefaultValueInput(str) {
      console.log(str)
      if (isArray(this.activeData.__config__.defaultValue)) {
        // 数组
        this.$set(
          this.activeData.__config__,
          'defaultValue',
          str.split(',').map(val => (isNumberStr(val) ? +val : val))
        )
      } else if (['true', 'false'].indexOf(str) > -1) {
        // 布尔
        this.$set(this.activeData.__config__, 'defaultValue', JSON.parse(str))
      } else {
        console.log(str,'.........',this.activeData.__config__)
        // 字符串和数字
        this.$set(
          this.activeData.__config__,
          'defaultValue',
          isNumberStr(str) ? +str : str
        )
        console.log(isNumberStr(str)?+str:str)
      }
    },
    onSwitchValueInput(val, name) {
      if (['true', 'false'].indexOf(val) > -1) {
        this.$set(this.activeData, name, JSON.parse(val))
      } else {
        this.$set(this.activeData, name, isNumberStr(val) ? +val : val)
      }
    },
    setTimeValue(val, type) {
      const valueFormat = type === 'week' ? dateTimeFormat.date : val
      this.$set(this.activeData.__config__, 'defaultValue', null)
      this.$set(this.activeData, 'value-format', valueFormat)
      this.$set(this.activeData, 'format', val)
    },
    spanChange(val) {
      this.formConf.span = val
    },
    multipleChange(val) {
      this.$set(this.activeData.__config__, 'defaultValue', val ? [] : '')
    },
    dateTypeChange(val) {
      this.setTimeValue(dateTimeFormat[val], val)
    },
    rangeChange(val) {
      this.$set(
        this.activeData.__config__,
        'defaultValue',
        val ? [this.activeData.min, this.activeData.max] : this.activeData.min
      )
    },
    rateTextChange(val) {
      if (val) this.activeData['show-score'] = false
    },
    rateScoreChange(val) {
      if (val) this.activeData['show-text'] = false
    },
    colorFormatChange(val) {
      this.activeData.__config__.defaultValue = null
      this.activeData['show-alpha'] = val.indexOf('a') > -1
      this.activeData.__config__.renderKey = +new Date() // 更新renderKey,重新渲染该组件
    },
    openIconsDialog(model) {
      this.iconsVisible = true
      this.currentIconModel = model
    },
    setIcon(val) {
      this.activeData[this.currentIconModel] = val
    },
    tagChange(tagIcon) {
      let target = inputComponents.find(item => item.__config__.tagIcon === tagIcon)
      if (!target) target = selectComponents.find(item => item.__config__.tagIcon === tagIcon)
      this.$emit('tag-change', target)
    },
    changeRenderKey() {
      if (needRerenderList.includes(this.activeData.__config__.tag)) {
        this.activeData.__config__.renderKey = +new Date()
      }
    },
    /* 选项卡相关 */
    addTab() {
      this.activeData.__slot__.options.push({
        title: '',
        name: '',
        content: 'this.children'
      })
      this.activeData.__config__.children.push(
        {
          __config__: {
            layout: 'rowFormItem',
            tagIcon: 'row',
            label: '行容器',
            layoutTree: true,
            document: 'https://element.eleme.cn/#/zh-CN/component/layout#row-attributes'
          },
          type: 'default',
          justify: 'start',
          align: 'top',
          componentName: 'el-row',
          itemBtns: false
        }
      )
      this.$emit('transTab', this.activeData)
    },
    deleteTab(index) {
      this.activeData.__slot__.options.splice(index, 1)
    },

    /* 折叠面板相关 */
    addCollapse() {
      this.activeData.__slot__.options.push({
        title: '',
        name: '',
        content: 'this.children'
      })
      this.activeData.__config__.children.push(
        {
          __config__: {
            layout: 'rowFormItem',
            tagIcon: 'row',
            label: '行容器',
            layoutTree: true,
            document: 'https://element.eleme.cn/#/zh-CN/component/layout#row-attributes'
          },
          type: 'default',
          justify: 'start',
          align: 'top',
          componentName: 'el-row',
          itemBtns: false
        }
      )
      this.$emit('transCollapse', this.activeData)
    },
  }
}
</script>

<style lang="scss" scoped>
.right-board {
  width: 350px;
  position: absolute;
  right: 0;
  top: 0;
  padding-top: 3px;
  .field-box {
    position: relative;
    height: calc(100vh - 42px);
    box-sizing: border-box;
    overflow: hidden;
  }
  .el-scrollbar {
    height: 100%;
  }
}

.select-item {
  display: flex;
  border: 1px dashed #fff;
  box-sizing: border-box;
  & .close-btn {
    cursor: pointer;
    color: #f56c6c;
  }
  & .el-input + .el-input {
    margin-left: 4px;
  }
}
.select-item + .select-item {
  margin-top: 4px;
}
.select-item.sortable-chosen {
  border: 1px dashed #409eff;
}
.select-line-icon {
  line-height: 32px;
  font-size: 22px;
  padding: 0 4px;
  color: #777;
}
.option-drag {
  cursor: move;
}
.time-range {
  .el-date-editor {
    width: 227px;
  }
  ::v-deep .el-icon-time {
    display: none;
  }
}
.document-link {
  position: absolute;
  display: block;
  width: 26px;
  height: 26px;
  top: 0;
  left: 0;
  cursor: pointer;
  background: #409eff;
  z-index: 1;
  border-radius: 0 0 6px 0;
  text-align: center;
  line-height: 26px;
  color: #fff;
  font-size: 18px;
}
.node-label{
  font-size: 14px;
}
.node-icon{
  color: #bebfc3;
}
/* 选项卡相关 */
.tabs-item {
  display: flex;
  border: 1px dashed #fff;
  box-sizing: border-box;
  .close-btn {
    cursor: pointer;
    color: #f56c6c !important;
  }
  + .tabs-item {
    margin-top: 4px;
  }
  .tabs-line-icon {
    line-height: 32px;
    font-size: 22px;
    padding: 0 4px;
    color: #777;
  }
  .option-drag {
    cursor: move;
  }
}
</style>
